package com.rado.tf.gui.view.menu;

import com.rado.tf.gui.i18n.MessageSource;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * Created by parado on 07.03.14.
 */
@Component(MenuPlugin.BEAN_NAME)
public class MenuPlugin
{
   public static final String BEAN_NAME = "menuPlugin";

   private static final String I18N_PREFIX = "menu.";

   @Resource
   private MessageSource messageSource;

   public Object[] menuItem(String key)
   {
      return new Object[]{
              messageSource.getMessage(I18N_PREFIX + key)
      };
   }
}
